package org.example.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.Data;

import java.util.Date;
import java.util.List;
//帖子实体类
@Data
@Document(collection = "posts")
public class Post {
    @Id
    private String id;
    
    private String userId;
    private String username;
    private String userAvatar;
    private String content;
    private List<String> fileIds; // 图片uuid
    private List<String> urls;//图片地址
    private Integer likes = 0; // 点赞数，默认0
    private List<String> likedBy; // 记录已点赞的用户ID
    private Date createTime;
    private Date updateTime;
    
    private List<Comment> comments; // 评论列表

    private Integer commentCount;//该帖子下面的总评论数量
}
